import { Component } from 'vue';
import MainLayout from '@renderer/layouts/MainLayout.vue'
const routes =  [
  {
    path: '/',
    name: 'main',
    component: MainLayout,
    redirect: '/main/dashboard',
    children: [
      {
        path: '/main/dashboard',
        name: 'MainDashboard',
        component: (): Promise<Component> => import('@renderer/pages/main/dashboard/index.vue'),
      },
      {
        path: '/main/code/generate',
        name: 'MainCodeGenerate',
        component: (): Promise<Component> => import('@renderer/pages/main/code/generate/index.vue'),
      },
      {
        path: '/main/template/debug',
        name: 'MainTemplateDebug',
        component: (): Promise<Component> => import('@renderer/pages/main/template/debug/index.vue'),
      },
      {
        path: '/main/datasource',
        name: 'MainDataSource',
        component: (): Promise<Component> => import('@renderer/pages/main/datasource/index.vue'),
      }
    ]
  },
  {
    path: "/app/preloading",
    name: "Preloading",
    component: (): Promise<Component> => import('@renderer/pages/app/preloading.vue'),
  },
  {
    path: '/dialog/edit/dataSource',
    name: 'EditDataSourceDialog',
    component: (): Promise<Component> => import('@renderer/pages/main/datasource/dialog/EditDataSourceDialog.vue'),
  },
  {
    path: '/preload/:id',
    name: 'preload',
    component: (): Promise<Component> => import('@renderer/pages/preview.vue'),
  },
  {
    path: '/app/checkUpdate',
    name: 'appCheckUpdate',
    component: (): Promise<Component> => import('@renderer/pages/app/checkUpdate.vue'),
  },
  {
    path: '/app/downloadUpdate',
    name: 'appDownloadUpdate',
    component: (): Promise<Component> => import('@renderer/pages/app/downloadUpdate.vue'),
  },
  {
    path: '/app/downloadedUpdateTips',
    name: 'appDownloadedUpdateTips',
    component: (): Promise<Component> => import('@renderer/pages/app/downloadedUpdateTips.vue'),
  }
]



export {
  routes
}
export default routes
